import request from '@/utils/request'

export function getUsersPlainList(departmentId) {
  return request({
    url: '/users/available',
    method: 'get',
    params: { departmentId }
  })
}

export function getUsersPlainListPresent(departmentId) {
  return request({
    url: '/users/present',
    method: 'get',
    params: { departmentId }
  })
}

export function showUsersList(query) {
  return request({
    url: '/users/show',
    method: 'get',
    params: query
  })
}

export function toggleFreeze(data) {
  return request({
    url: '/users/block',
    method: 'post',
    data
  })
}

export function deleteUser(userId) {
  return request({
    url: '/users/remove',
    method: 'get',
    params: { 'userId': userId }
  })
}

export function saveOrUpdateUsers(data) {
  return request({
    url: '/users/save',
    method: 'post',
    data
  })
}

export function importUsersByExcel(filePath, departmentId) {
  return request({
    url: '/users/import',
    method: 'get',
    params: { filePath, departmentId }
  })
}

export function compareUsersByExcel(filePath, departmentId) {
  return request({
    url: '/users/compare',
    method: 'get',
    params: { filePath, departmentId }
  })
}

export function exportUsersToExcel(departmentId) {
  return request({
    url: '/users/export',
    method: 'get',
    params: { departmentId }
  })
}

export function leaveUsersByExcel(filePath, departmentId) {
  return request({
    url: '/users/leave',
    method: 'get',
    params: { filePath, departmentId }
  })
}

export function changePassword(data) {
  return request({
    url: '/users/pwd/reset',
    method: 'post',
    data
  })
}

export function showUserForgetList(query) {
  return request({
    url: '/users/forget/show',
    method: 'get',
    params: query
  })
}

export function deleteUserForget(forgetId) {
  return request({
    url: '/users/forget/remove',
    method: 'get',
    params: { 'forgetId': forgetId }
  })
}

export function handleUserForget(forgetId) {
  return request({
    url: '/users/forget/handle',
    method: 'get',
    params: { 'forgetId': forgetId }
  })
}

export function showUserFeedback(query) {
  return request({
    url: '/feedback/show',
    method: 'get',
    params: query
  })
}

export function deleteUserFeedback(feedbackId) {
  return request({
    url: '/feedback/remove',
    method: 'get',
    params: { 'feedbackId': feedbackId }
  })
}

export function readUserFeedback(feedbackId) {
  return request({
    url: '/feedback/read',
    method: 'get',
    params: { 'feedbackId': feedbackId }
  })
}
